The Delete User Setting operation deletes the specified user setting object for the specified user ID.

Request

The Delete User Setting request may be specified as follows. Replace <user-id> with your user ID and <setting-id> with your setting ID

Method Request URI HTTP Version

DELETE

https://admin-management.contoso.net/resourceproviders/<user-id>/settings/<settings-id>

HTTP/1.1

URI Parameters

None.

Request Headers

The following table describes request headers.

Request Header Description

Authorization

Specifies the credentials for this request. The value of this header must be set Negotiate <token>.

Request Body

  Copy Code
<SettingBatch xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Microsoft.WindowsAzure.Management.Setting.Client.DataContracts">
   <Method>Get</Method>
   <SettingCollection>
	<Setting>
		 <ExpirationInDays i:nil="true" />
		 <Name>Some Setting Name</Name>
		 <Path>Some path</Path>
		 <Value>ABC</Value>
	</Setting>
   </SettingCollection>
   <SettingStoreId>
	<Id>user@contoso.com</Id>
	<Store>Some store</Store>
	<Type>User</Type>
   </SettingStoreId>
</SettingBatch>

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

  Copy Code
<SettingCollection xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Microsoft.WindowsAzure.Management.Setting.Client.DataContracts"></SettingCollection>

Example

Delete a user setting.

  Copy Code
public void DeleteUserSetting(string adminServiceEndpoint)
{
	HttpClient httpClient = new HttpClient();
	httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("BASIC", Convert.ToBase64String(UnicodeEncoding.Unicode.GetBytes("AdminPortal:" + ”password”)))));

	string subscriptionEndpoint = adminServiceEndpoint + "settings/";
	var settingStoreId = new SettingStoreId("Global", "User", "test@test.com");
	var setting = new Setting()
	{
		Path = "some path",
		/* This parameter can be modified to delete all settings in a particular path.
		 If the name is mentioned, it will delete the setting in the specified path 
		 with the specified name; otherwise it deletes ALL settings in the specified path. */
		Name = "setting name",
};

	var settingCollection = new SettingCollection { setting };
	var batch = new SettingBatch(settingStoreId, settingCollection, SettingMethods.Delete);

	Console.WriteLine(httpClient.PostAsXmlAsync<SettingBatch>(subscriptionEndpoint, batch).Result.EnsureSuccessStatusCode() + "Successfully deleted user Setting");
}