Forum Widgets
Latest Discussions
Enabling and disabling forwarding rule
Hello, We need to turn on a mail forwarding rule on a single mailbox, within 365. We looked at using a Azure Function App and copilot got us most of the way there but need some help with a 400 error. Failed to enable rule: The remote server returned an error: (400) Bad Request. The API authenticates and has the Mail.ReadWrite and Mail.Send and seems to be happy there. Is there a reason why this is giving a 400 error as all the details (I thought) were in order. # Azure AD App details $clientId = "your-client-id" $clientSecret = "your-client-secret" $tenantId = "your-tenant-id" # Function parameters $mailbox = "email address removed for privacy reasons" $ruleId = "086b4cfe-b18a-4ca0-b8a6-c0cc13ab963e3208025663109857281" # Provided rule ID without backslash # Get OAuth token $body = @{ client_id = $clientId client_secret = $clientSecret scope = "https://graph.microsoft.com/.default" grant_type = "client_credentials" } try { $response = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token" -Method Post -ContentType "application/x-www-form-urlencoded" -Body $body $token = $response.access_token Write-Output "Token acquired successfully." } catch { Write-Error "Failed to get OAuth token: $_" return } # Enable the existing rule $headers = @{ Authorization = "Bearer $token" ContentType = "application/json" } $body = @{ isEnabled = $true } try { $jsonBody = $body | ConvertTo-Json Write-Output "JSON Body: $jsonBody" $response = Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/users/$mailbox/mailFolders/inbox/messageRules/$ruleId" -Method Patch -Headers $headers -Body $jsonBody Write-Output "Rule enabled successfully: $($response | ConvertTo-Json)" } catch { Write-Error "Failed to enable rule: $_" Write-Output "Response Status Code: $($_.Exception.Response.StatusCode)" Write-Output "Response Status Description: $($_.Exception.Response.StatusDescription)" if ($_.Exception.Response -ne $null) { $responseContent = $_.Exception.Response.Content.ReadAsStringAsync().Result Write-Output "Response Content: $responseContent" } else { Write-Output "No response content available." } } # Return response Write-Output "Script completed."SolvedTwrriglesworthDec 09, 2024Copper Contributor77Views1like3CommentsHow to solve issue: Incorrect worker runtime specified for function app (AZFD0013)?
Hi, (I apologize if this post is placed incorrectly within the community.) we've used app Start/Stop VMs during off hours - V2 (GitHub - microsoft/startstopv2-deployments) (Start/Stop VMs during off hours - V2 - Microsoft Azure) It worked without any issues, but 8.10 we received the notification described in the article: AZFD0013: The configured runtime does not match the worker runtime metadata found in the deployed function app artifacts. - Azure Functions | Microsoft Learn. In the notification it was written: We have a new Functions recommendation for startstopvm23dvt65bpvxrmw Incorrect worker runtime specified for function app We've noticed that your function app (**startstopvm23dvt65bpvxrmw**) is configured with the FUNCTIONS_WORKER_RUNTIME setting as "dotnet-isolated", but expected value for the deployed application payload is "dotnet". This is an unoptimized state which limits performance and may impact application reliability. To help detect this, you may now see the AZFD0013 event raised at the Warning level in your logs. This will be raised to Error level in a future update. To ensure your app can run properly, for its current payload, you should set the FUNCTIONS_WORKER_RUNTIME value to "dotnet". You must also update any deployment automations you have, such as templates or CI/CD pipelines, so they specify the correct value as well. Please see https://aka.ms/functions-invalid-worker-runtime for more information. If I understand correctly, our FUNCTIONS_WORKER_RUNTIME is set to "dotnet-isolated", and we should reset it to "dotnet" But in the GitHub documentation I found: August 19, 2024 Start/Stop v2 has been migrated to the .NET 8 isolated worker model. https://github.com/microsoft/startstopv2-deployments?tab=readme-ov-file#upcoming-or-recent-updates-to-startstop-v2 When I checked the application settings in Azure, I also get this notification. When I look in the configuration, there it is set as it is written in GitHub - I assume this setting is correct When I look in the environment variables, and look for FUNCTIONS_WORKER_RUNTIME. So there is dotnet-isolated. But I don't know if by changing this variable, something will not work on dotnet, when the configuration is also set to .NET 8 Isolated? Can anyone advise me on how to proceed to eliminate this problem? Thanks for all the tips, tricks and advice TomSolvedTomasGOct 22, 2024Brass Contributor1.6KViews0likes2CommentsMicrosoft Entra ID App not accessible to other organisations
Hi all, I have an external PHP-based application that allows users to send emails via the Microsoft Graph API instead of SMTP which will be deprecated soon. For this, I registered an application under Entra App registrations with delegated permission scopes Mail.Send and offline_access. The app is configured to allow all types of Microsoft accounts, and during testing with personal and internal company Microsoft accounts, everything works perfectly. I'm using the authorization code flow for authentication: The user logs in. The user consents to the required permissions (prompt=consent). The user is redirected back to the application with an access and refresh token. However, when a user with a external company (organizational) account tries to authorize the app, they encounter the following error after logging in: AADSTS650053: The application 'My App Name' requested scope 'offline_access, Mail.Send' which doesn't exist on the resource '00000003-0000-0000-c000-000000000000'. Contact the app vendor. I’ve tried various configurations but haven’t been able to resolve the issue. My question is: does the external company tenant require any specific configuration, or am I missing something on my end? How can I get this working for organizational accounts if it's already functioning for personal Microsoft accounts? Any help or suggestions would be greatly appreciated. Best regards, Ricardas KauneckasSolvedricardaskauneckasSep 30, 2024Copper Contributor237Views0likes2CommentsHow to let function core tools to initialize local.settings.json?
Hello, I deleted a storage account by mistake, which is used by azure function core tools for uploading and holding app resources. I tried to create a new storage account and replace connection strings in "local.settings.json", but not worked. The tools continuously say azure storage not found. I also tried to create a project from maven archetype, not worked either. Could anybody help tell me how to let the tools create the storage automatically and reinitialize the settings? Thanks a lot! Best regards. BillSolvedbill-xuNov 30, 2023Copper Contributor400Views0likes1CommentAzure Functions permissions and costs
Hello guys, I am new to azure functions. There are a few questions that I cannot find answers to in the docs. Costs Do I have to pay when I create a new Azure Function? (Not the app) Do I pay for test runs? Permissions I have a licence from my company but I do get errors when creating a new function: "The function is unavailable for editing in the portal. Click to download app content and use a local development environment to fix the function." I do have a local environment with VS Code but do not have permissions to edit the files. What permissions do I need to create a function? What permissions do I need to edit files locally (and where can they be adjusted) ?SolvedNilsJJAug 14, 2023Copper Contributor3KViews0likes3CommentsHow to escape a password containing a backslash \ in azure SQL server database connection string
Hello, I have a password that contains a \ and I tried to escape using a double backslash and it is not working. Anyone has another solution. ThanksSolvedKadeabdulJul 14, 2023Copper Contributor2.8KViews0likes3CommentsHow to escape special character in azure slq server conncetion string password?
Hello, my connection string has a password with special character that starts with ^******* and I am having issue on how to escape in upsetting Json file. Please help needed.SolvedKadeabdulJul 14, 2023Copper Contributor4.7KViews0likes2CommentsLogic App Designer is not displaying the Logic App flow
Hello, I have created a Logic App which was normally running and is still getting triggered if I call it through Postman. Last days I can not see the flow in designer (when I click edit), or see the Flow in runs History. Please advice. I tried even to go to "Logic App Code View" to get the json code and tried to re-import it hoping it will display the logic app flow, but even the json code is not displayed (stucks on loading / displaying 3 dots)SolvedAndreasCharApr 05, 2023Copper Contributor8.5KViews0likes4CommentsHow to assign multiple user-managed-identities to Azure Web App depending on the AD user
I have a single Azure Web App that connects back to Azure Flexible Postgres using AD authentication. I've managed to add the AD Administrator to Postgres and add two user managed identities as Postgres roles (both of which have different permissions and access to different database tables). The Azure Web App is set up with Authentication on a single tenant, and I have restricted access to certain AD users/groups within the Enterprise Application. What I want is to be able to assign the two different user managed identities to different active directory users, who I have granted access to the application. This is to define what data they are able to view within the application (given the different Postgres roles assigned to the two different user managed identities). However, how do I do this if I add the two user-managed-identities to the Azure Web App? Currently any user who has access to the application can request access tokens for either user managed identity, so long as they know the Object ID of the managed identity. The access token is being generated within the app by the node version of azure/identity with the following commands: const credential = new DefaultAzureCredential({ managedIdentityClientId: '<client-id-of-user-assigned-identity>' }) const accessToken = await credential.getToken("https://ossrdbms-aad.database.windows.net") This poses an additional question - how would I pass the client ID of the managed identity to the application, depending on the AD user, as I don't wish to hard code this into the application. One assumes if it's possible to link a managed identity to a AD User (as I am seeking to do here), it should be possible to get this dynamically, however I see no option for this within the custom claims options for JWT, and when I try and add custom options (that aren't within the drop down lists), I get an error about adding signing keys. Is this scenario possible? I really don't want to have to have two applications to manage the two different postgres user permissions! Thanks, EdSolvededdie89Feb 25, 2023Copper Contributor2.2KViews0likes1Commentregister app SQL sever on-prem in Azure
Is it possible to register SQL sever on-prem app in Azure and how?SolvedAtanasMDec 05, 2022Iron Contributor1.3KViews0likes5Comments
Resources
Tags
- web apps73 Topics
- AMA47 Topics
- azure functions37 Topics
- Desktop Apps10 Topics
- Mobile Apps9 Topics
- azure kubernetes service3 Topics
- community2 Topics
- Azure Data Explorer AMA1 Topic
- azure1 Topic
- Feature Request1 Topic