The Update Resource Provider operation creates a resource provider with a resource provider object provided in the body of the post.
Request
The Update Resource Provider request may be
specified as follows. Replace
<resource-provider-id>
with your resource
provider ID
Method | Request URI | HTTP Version |
---|---|---|
PUT |
|
HTTP/1.1 |
URI Parameters
None.
Request Headers
The following table describes request headers.
Request Header | Description |
---|---|
Content-Type |
Set this header to application/xml; charset=utf-8. |
Authorization |
Specifies the credentials for this request. The value of this header must be set Negotiate <token>. |
Request Body
The format for the request body is as follows:
Copy Code | |
---|---|
<ResourceProvider xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure"> <Name>DADHQ32B</Name> <DisplayName>DisplayName:DADHQ32B</DisplayName> <Enabled>true</Enabled> <PassThroughEnabled>true</PassThroughEnabled> <AdminEndpoint> <ForwardingAddress>http://admin-management.contoso.net/dummy/DADHQ32B/AdminEndpoint</ForwardingAddress> </AdminEndpoint> <TenantEndpoint> <ForwardingAddress>http://admin-management.contoso.net/dummy/DADHQ32B/TenantEndpoint</ForwardingAddress> </TenantEndpoint> <NotificationEndpoint> <ForwardingAddress>http://admin-management.contoso.net/dummy/DADHQ32B/NotificationEndpoint</ForwardingAddress> </NotificationEndpoint> </ResourceProvider> |
Important |
---|
The order of the elements in the request body is significant. If an element is required, it must appear in the XML in the order shown above. |
The following table describes the key elements of the request body:
Element Name |
Description |
Name |
A name for the resource provider that is unique. Must use numbers and letters only. |
Display name |
The name can be used identify the resource provider for your tracking purposes. |
Enabled |
Specifies whether the resource provider is created in enabled state. |
PassThroughEnabled |
Specifies whether the resource provider is created in passthrough-enabled state. |
AdminEndpoint |
Specifies the forwarding address for the administrator endpoint |
TenantEndpoint |
Specifies the forwarding address for the tenant endpoint |
NotificationEndpoint |
Specifies the forwarding address for the notification endpoint |
Response
The response includes an HTTP status code, a set of response headers, and a response body.
Status Code
The status code is embedded in the response for this operation; if successful, it will be status code 200 (OK).
Response Headers
The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
Response Header | Description |
---|---|
None |
None |
Response Body
None.
Example
Update a resource provider.
Copy Code | |
---|---|
public void UpdateResourceProvider(string adminServiceEndpoint, string rpname) { HttpClient httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("BASIC", Convert.ToBase64String(UnicodeEncoding.Unicode.GetBytes("AdminPortal:" + password))))); // Create a subscription for the above user account string subscriptionEndpoint = adminServiceEndpoint + "resourceproviders/"+rpname; ResourceProvider resproviderInfo = new ResourceProvider("BotResProvider", "BotResProviderName") { Enabled = false, AdminEndpoint = new AdminEndpoint("http://energy:8005/dummy/DADHQ32B/AdminEndpoint"), TenantEndpoint = new TenantEndpoint("http://energy:8005/dummy/DADHQ32B/TenantEndpoint"), NotificationEndpoint = new NotificationEndpoint("http://energy:8005/dummy/DADHQ32B/NotificationEndpoint"), }; Console.WriteLine(httpClient.PutAsXmlAsync<ResourceProvider>(subscriptionEndpoint, resproviderInfo).Result.EnsureSuccessStatusCode() + "\n Successfully updated Resource Provider"); } |