Giter Site home page Giter Site logo

azure-samples-net-management's Introduction

Code Samples of Azure .NET SDK Management Libraries

This repo contains code samples that demonstrate the usage of management client libraries of Azure .NET SDK.

To find the code samples for a particular service you are using, please click on the folder that you're interested in. Each folder name is based on the Azure service, eg. Compute / Network / Storage

Samples:

Other

azure-samples-net-management's People

Contributors

archerzz avatar arthurma1978 avatar dependabot[bot] avatar erich-wang avatar harveylink avatar mcgallan avatar memontic-ms avatar microsoft-github-operations[bot] avatar microsoftopensource avatar nickzhums avatar rickvdbosch avatar usvoyager avatar xboxeer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-samples-net-management's Issues

How do you get the resource group of a virtual machine?

Hello,

I'm having trouble finding the resourcegroup property of a vm instance.

            var computeClient = new ComputeManagementClient(subscriptionId, new DefaultAzureCredential());
            var virtualMachines = computeClient.VirtualMachines;

                foreach (var virtualMachine in virtualMachines.ListAll())
                {

                    foreach (KeyValuePair<string, string> tag in virtualMachine.Tags)
                    {

                        if(tag.Key.Equals("sla") && (tag.Value.Equals("businessday")))
                        {
                            log.LogInformation("found vms with tag: " + virtualMachine.Name);

                            

                            //await virtualMachines.StartDeallocateAsync(, virtualMachine.Name);
                        }
                    }
                }

As stated on https://docs.microsoft.com/en-us/dotnet/api/azure.resourcemanager.compute.virtualmachinesoperations.startdeallocateasync?view=azure-dotnet-preview
virtualMachines.StartDeallocateAsync requires resourcegroupname parameter.

Thanks in advance

Resources created with .NET SDK aren't listed in deployment history

When creating a resource through the Azure portal the deployment history can be viewed for the resource group and it also provides a preview of the ARM template and parameters of the deployment. For example of what I mean, please see this article: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-history?tabs=azure-portal#resource-group-deployments.

However, when I create resources programmatically with the .NET SDK (not using ARM), my new resources do not show in the deployment history for the resource group.

Is there something additional I need to do in the SDK for the deployments to show in the deployment history?

Unable to create ResourceGroup with Tags

Unable to create a ResourceGroup with the provided code sample in ManageResourceGroup project

image

I am getting an error
Property or indexer 'ResourceGroup.Tags' cannot be assigned to -- it is read only

Some classes not in namespace after updating Azure.ResourceManager.Resources from preview to 1.0.0

I cloned my repo and updated the Azure.Identity and Azure.ResourceManager.Resources packages to the latest versions. This caused issues, so I reverted the changes. I tried just updating Azure.ResourceManager.Resources from 1.0.0-preview.1 to version 1.0.0 and suddenly some classes were no longer in the namespace.

The classes/objects I spotted with issues were in the resources/deploy-using-arm-template project:

  • ResourceManagementClient
  • ResourceGroup
  • Deployment
  • DeploymentProperties
  • DeploymentMode

Sample for .ContainerInstances

Hi!

I'm migrating from the old management SDK and struggling with creating container instances with a lot of options. Example would be appreciated.

How do I set exposed UDP ports, and command line options? With the old Fluent SDK it was done like this:

.DefineContainerInstance(containerId + "-1")
                .WithExternalUdpPort(51234)
                .WithStartingCommandLine(_containerConfig.ImageExecutable, arguments)
                .Attach()

Get Public IP Address ResourceId from IP Address

Is there a way to get the Azure Resource ID of a given Public IP if we know the IP address?

Input:- 40.81.207.37
Output:- /subscription/xxxx/resourceGroups/xxxx/providers/Microsoft.Network/publicIPAddresses/

Azure.ResourceManager.Network.PublicIPAddressCollection doesn't seem to have the necessary method..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.