Malibloo
Malibloo
CC#
Created by Malibloo on 5/4/2023 in #help
❔ Azure daemon SQL database Authentication
I'm absolutely panicking. Something turned on FMA for an account I used to do database things through a headless program I made, and I can't get it to work anymore. The short explanation is that I have an Azure SQL server and also an Azure server which has a program on the VM that runs without user input on a schedule (I should probably be using devops, but I can't figure out how). This program contacts several third party APIs and accesses the Azure database. I used to do this with a simple username+password in a flat file that's used in a connectionstring to create a DbContext, mostly because lazy and no one else would be accessing the server anyway. But clearly that doesn't work anymore. I have tried many a things with the connection string, changing the Authentication type with tenant ids and secrets, but everything bring back errors that I can't troubleshoot, and won't bother people here with, because it'd be an XY problem situation. I've also attempted to use postman to get some kind of oauth2 key to use, but it requires a scope, and I can't even find what scope "access this specific database" would be called. In short, it's a straw in a haystack situation where I simply don't know what to look for or what would even make sense at this point. I wouldn't even know where to go to gain this info, everything just refers to each other and uses nomenclature that's alien to me. Any help and direction is appreciated. Please and thank you. I'm also starting to wonder if there's an Azure specific discord server. Nevermind, that server seems to be semi-dead.
3 replies
CC#
Created by Malibloo on 12/30/2022 in #help
❔ JSON Serialization Weird Model
Hey all, I have a situation where I need to approach a REST service with a POST containing either XML or JSON. However, the data that I need to input has a strange (to me) model structure that I'm not sure how I would serialize without creating a ridiculous ToString override that I'd need to recreate for every other approach that would also use similar models, which is clearly a terrible idea. The other alternative is creating a mass amount of models with a lot of identical names which would make putting in the necessary data an absolute nightmare. While I know the basics of json serialization, I haven't had to deal with a situation like this before. Is there any way to make this much easier, or am I just stuck with coding myself through a nightmare every single time I need to approach this service? Example of the data in json form:
{
"Subject": {
"Element": {
"@SbId": 9999,
"Fields": {
"StId": 0,
"Ds": "Subject Test",
"Da": "2022-12-30T12:00:00"
},
"Objects": [
{
"SubjectLink": {
"Element": {
"Fields": {
"ToBC": false
}
}
}
},
{
"SubjectAttachment": {
"Element": {
"Fields": {
"FileName": "Filename",
"FileId": "0"
} } } } ] } } }
{
"Subject": {
"Element": {
"@SbId": 9999,
"Fields": {
"StId": 0,
"Ds": "Subject Test",
"Da": "2022-12-30T12:00:00"
},
"Objects": [
{
"SubjectLink": {
"Element": {
"Fields": {
"ToBC": false
}
}
}
},
{
"SubjectAttachment": {
"Element": {
"Fields": {
"FileName": "Filename",
"FileId": "0"
} } } } ] } } }
49 replies