Ich mache eine Android-App, die eine Verbindung zu einem Azure Storage-Konto herstellt, um Informationen in einer Tabelle zu speichern. Wenn ich die App im Simulator starte und auf die Schaltfläche klicke, die die Seite öffnet, die mit der Datenbank verbunden ist, erhalte ich die Ausnahme "Shared Key wird nicht mit der PCL unterstützt. Bitte verwenden Sie ein SAS-Token."Wo verwende ich SAS Token in Xamarin.Android
Also habe ich die Schritte ausgeführt, um ein SAS-Token zu generieren, aber ich bin mir nicht sicher, was ich mit der Zeichenfolge tun soll. Kann jemand vorschlagen, wo ich die Schnur legen sollte?
namespace UndergroundSports
{
[Activity]
public class austinBowlingSignUpPage : Activity
{
protected override async void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
SetContentView (Resource.Layout.austinBowlingSignUpPage);
EditText austinBowlingFullNameEntry = FindViewById<EditText> (Resource.Id.austinBowlingFullNameEntry);
EditText austinBowlingEmailEntry = FindViewById<EditText> (Resource.Id.austinBowlingEmailEntry);
Button austinBowlingSubmitButton = FindViewById<Button> (Resource.Id.austinBowlingSignUpButton);
string sas = "https://undergroundathletes.blob.core.windows.net/underground-container?sv=2015-04-05&sr=c&sig=Gcgc28K%2B\nc6uQk9pkHRAotshR7zEU%3D&se=2016-04-20T18%3A13%3A31Z&sp=rwdl";
string connectionString =
"DefaultEndpointsProtocol=http;" +
"AccountName=My_Account_Name;" +
"AccountKey=My_Account_Key";
CloudStorageAccount storageaccount = CloudStorageAccount.Parse (connectionString);
CloudTableClient tableClient = storageaccount.CreateCloudTableClient();
CloudTable austinBowlingAthletes = tableClient.GetTableReference ("austinBowlingAthletesTable");
await austinBowlingAthletes.CreateIfNotExistsAsync();
austinBowlingSubmitButton.Click += async (sender, e) => {
austinBowlingAthlete austinBowlingAthlete1 = new austinBowlingAthlete();
austinBowlingAthlete1.fullname = austinBowlingFullNameEntry.ToString();
austinBowlingAthlete1.email = austinBowlingEmailEntry.ToString();
TableOperation insertOperation = TableOperation.Insert(austinBowlingAthlete1);
await austinBowlingAthletes.ExecuteAsync(insertOperation);
};
}
}
}
Wo auf dem Azure-Portal kann ich die Uri, die ich in tableStorageUri verwenden? –
Ich denke, ich habe es gefunden ... es ist unter "Table Service Endpoint" auf dem Tables Blade, oder? Mit dem Format: https://storageaccountname.table.core.windows.net/ –
@ msloan11: Ich denke schon – Giorgi