question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Cannot create a Managed application definition

See original GitHub issue

Describe the bug I am trying to create a Managed Application Definition. My request failed because of “InvalidRequestContent” exception. I turned on logging and noticed that the body of the request doesn’t include ‘properties’. Code snippet and screenshot of the request details are attached. Please find them below.

Exception or Stack Trace InvalidRequestContent due to missed data in the request’s body

To Reproduce Please try code snippet below.

Code Snippet `

 var managedAppDefProperties =
      new
      {
            lockLevel = "ReadOnly",
            displayName = "test",
            description = "test",
            packageFileUri = packageFileUri,
            authorizations = new object[] { new { principalId = principalId, roleDefinitionId = roleDefinitionId } }
      };
azureClient.GenericResources
      .Define(managedAppDefName)
      .WithRegion(region)
      .WithExistingResourceGroup(existingResourceGroup)
      .WithResourceType("applicationDefinitions")
      .WithProviderNamespace("Microsoft.Solutions")
      .WithoutPlan()
      .WithApiVersion("2019-07-01")
      .WithProperties(managedAppDefProperties)
      .WithTag("key", "value")
      .Create();

`

Expected behavior Request body should contain defined properties

Screenshots api_issue

Setup (please complete the following information):

  • OS: Windows 10
  • IDE : Visual Studio 2019
  • Version of the Library used: 1.38.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
weidongxu-microsoftcommented, Oct 13, 2021

@sergiygetlin

The object to withProperties is to be serialized to JSON.

I am not sure what type will be created via the syntax in your code. Could you try IDictionary?

0reactions
sergiygetlincommented, Oct 14, 2021

Yes that was my initial assumption. Fluent flow allows to call methods in a certain order. I couldn’t find WithKind. I checked with reflector this assembly “Microsoft.Azure.Management.ResourceManager.Fluent.dll” and didn’t find anything. It is not critical, but just want to find out how to do it in fluent way. Just in case…

I partially switched to the new SDK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't deploy my Managed Application from Azure ...
I created Azure Managed Application. I successful deployed it to my subscription over Service catalog managed application definitions like ...
Read more >
Azure Managed Application randomly fails to provision
Managed resource group is created however no deployment is scheduled for it. This behaviour is random. It used to work more stable. The ......
Read more >
Issues · Azure/azure-libraries-for-net
Net. Contribute to Azure/azure-libraries-for-net development by creating an account on GitHub. ... [BUG] Cannot create a Managed application definition.
Read more >
Managed application deployment failes when policy ...
Is it possible to create managed resource group with proper tags using managed application definition? Azure Managed Applications.
Read more >
Cannot access the organization that I created
New AAD-backed Azure DevOps Services orgs have their “External guest access” policy disabled by default. This means AAD guests can't log into ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found