第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Azure HTTP 函數(shù)無法發(fā)布

Azure HTTP 函數(shù)無法發(fā)布

C#
慕慕森 2023-12-17 10:23:08
我正在嘗試將我的 Azure HTTP 函數(shù)從 Visual Studio Code 發(fā)布到我們的 Azure 平臺。該代碼在本地運行該函數(shù)時工作正常并成功發(fā)布,但在發(fā)布時拋出以下錯誤。我嘗試使用 DocumentDB 而不是 CosmosDB,但缺乏將數(shù)據(jù)插入 CosmosDB 所需的插入功能。 Stackoverflow 沒有針對此類特定問題的解決方案。功能碼//write to cosmosdb[FunctionName("InsertItem")] public static HttpResponseMessage Run(     [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)]HttpRequestMessage req,     [CosmosDB(         databaseName: "ToDoList",         collectionName: "RFIDContainer",         ConnectionStringSetting = "myCosmosDBConnection")]     out RFIDBaseTag document,     ILogger log) {     string hexData = "";    string afi = "";    string eid = "";    string dsfid = "";    //Guid DeviceID = new Guid();    //Guid AppID = new Guid();    var content = req.Content;     string jsonContent = content.ReadAsStringAsync().Result;     dynamic json = JsonConvert.DeserializeObject<MyClass>(jsonContent);    hexData = json?.hexData;    afi = json?.afi;    eid = json?.eid;    dsfid = json?.dsfid;    /*Guid devGuid;    Guid.TryParse(json.AppID.ToString(), out devGuid);    DeviceID = devGuid;    Guid appGuid;    Guid.TryParse(json.AppID.ToString(), out appGuid);    AppID = appGuid;*/    byte[] hexToByte = AzureRFIDTagReader.StringToByteArray(hexData);    RawRFIDReading raw = new RawRFIDReading();    raw.afi = afi;    raw.eid = eid;    raw.dsfid = dsfid;    raw.RawData = hexToByte;    RFIDBaseTag rtag = RFIDTagFactory.GetTag(raw);    string serializedtag = JsonConvert.SerializeObject(rtag);    //document = JsonConvert.DeserializeObject<MyClass>(jsonContent);    //document = JsonConvert.DeserializeObject<RFIDBaseTag(serializedtag);    document = rtag;    log.LogInformation($"C# Queue trigger function inserted one row");    return new HttpResponseMessage(HttpStatusCode.Created); }錯誤信息:函數(shù)(xxx/InsertItem)錯誤:Microsoft.Azure.WebJobs.Host:索引方法“InsertItem”錯誤。 Microsoft.Azure.WebJobs.Host:無法解析屬性“CosmosDBAttribute.ConnectionStringSetting”的值。確保該設(shè)置存在并且具有有效值。我可以在本地發(fā)布該函數(shù),但不能在 Azure 上發(fā)布。有什么建議么?
查看完整描述

1 回答

?
米琪卡哇伊

TA貢獻1998條經(jīng)驗 獲得超6個贊

當您發(fā)布函數(shù)時,您的local.settings.json文件不會發(fā)布。

您需要將這些設(shè)置添加為 Azure Functions 應(yīng)用程序設(shè)置的一部分。在您的情況下,您需要在其中添加 myCosmosDBConnection 值。



查看完整回答
反對 回復(fù) 2023-12-17
  • 1 回答
  • 0 關(guān)注
  • 122 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號