Azure / azure-sdk-for-rust

This repository is for active development of the *unofficial* Azure SDK for Rust. This repository is *not* supported by the Azure SDK team.
MIT License
692 stars 237 forks source link

Missing field `location` in azure_mgmt_postgresql #1317

Open jetuk opened 1 year ago

jetuk commented 1 year ago

I am trying to use the management crate azure_mgmt_postgresql (v0.13.0) to create a new flexible server. However, despite setting the location field of the tracked_resource part of the Server definition I am receiving an error that the location field is missing.

I do not understand what I am doing wrong. There is no other location field as far as I can tell. Is there anyway to resolve this issue? Have I configured the request incorrectly?

The error:

Error { context: Custom(Custom { kind: DataConversion, error: Error("missing field `location`", line: 1, column: 88) }) }

My server definition:

    // Snip

    let parameters = Server {
        tracked_resource: TrackedResource {
            resource: Default::default(),
            tags: None,
            location: location.to_string(),   // location = "uksouth"
        },
        sku: Some(sku),
        identity: None,
        properties: Some(properties),
        system_data: None,
    };

    client
        .servers_client()
        .create(
            subscription_id,
            resource_group_name,
            server_name,
            parameters,
        )
        .await?;
cataggar commented 11 months ago

The best way to troubleshoot would be to use an HTTP proxy like Fiddler4 to verify the request is what is expected. $env:HTTPS_PROXY="http://localhost:8888". You could also just serialize that example to see if it is producing the expected request.